#include<iostream>
using namespace std;
//struct hjx
//{
//   hjx* _pre;
//   hjx* _next;
//   int _val;
////   void* operator new(size_t n)
////   {
////       void *p=nullptr;
////       p=allocator<hjx>().allocate(1);//内存池
////       cout<<"申请内存池"<<endl;
////       return p;
////   }
//void *operator new(size_t n)
//{
//    void *p=nullptr;
//    p=allocator<hjx>().allocate(1);
//    cout<<"申请内存池"<<endl;
//    return p;
//}
////   void operator delete(void *p)
////   {
////       allocator<hjx>().deallocate((hjx*)p,(1));
////       cout<<"销毁内存池"<<endl;
////   }
//void operator delete(void *p)
//{
//    allocator<hjx>().deallocate((hjx*)p,(1));
//    cout<<"销毁内存池"<<endl;
//}
//
//};
//class List
//{
//public:
//    List()
//    {
//        _hh=new hjx;
//        _hh->_next=_hh;
//        _hh->_pre=_hh;
//    }
//    ~List()
//    {
//        hjx*cur=_hh->_next;
//        while(cur!=_hh)
//        {
//            hjx*next=cur->_next;
//            delete cur;
//            cur=next;
//        }
//        delete _hh;
//        _hh=nullptr;
//    }
//private:
//    hjx*_hh;
//};
//int main()
//{
//   List l;
//}
struct Lode
{
    int _val;
    Lode*_next;
    Lode*_pre;
    void *operator new(size_t n)
    {
        void *p=nullptr;
        p=allocator<Lode>().allocate(1);
        cout<<"申请内存池"<<p<<endl;
        return p;
    }
    void operator delete(void *p)
    {
        allocator<Lode>().deallocate((Lode*)p,(1));
        cout<<"销毁内存池"<<endl;
    }
};
class List
{
public:
    List()
    {
        _hh=new Lode;
        _hh->_pre=_hh;
        _hh->_next=_hh;
    }
    ~List()
    {
        Lode*cur=_hh->_next;
        while(_hh!=cur)
        {
            Lode* next=cur->_next;
            delete cur;
            cur=next;
        }
        delete _hh;
        _hh=nullptr;
    }
private:
    Lode*_hh;
};
int main()
{
   List l;
}






































